<template>
  <div class="settings-layout">
    <el-card class="preferences-group">
      <template #header>
        <div>偏好设置</div>
      </template>
      <el-select v-model="language" class="language-combo">
        <el-option label="简体中文" value="zh-CN"></el-option>
        <el-option label="English" value="en-US"></el-option>
      </el-select>
      <el-checkbox v-model="showTrayIcon">显示系统托盘图标</el-checkbox>
    </el-card>

    <el-card class="links-group">
      <template #header>
        <div>相关链接</div>
      </template>
      <div class="links-list">
        <a href="https://ffmpeg.org/" target="_blank">FFmpeg官方网站</a>
        <a href="https://github.com/FFmpeg/FFmpeg" target="_blank">FFmpeg GitHub</a>
      </div>
    </el-card>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from 'vue';

export default {
  name: "SettingsTab",
  setup() {
    const state = reactive({
      language: "zh-CN",
      showTrayIcon: true
    });

    const saveSettings = () => {
      // 保存设置的逻辑
      console.log("保存设置:", state.language, state.showTrayIcon);
      // 这里可以添加实际的保存逻辑
    };

    return {
      ...toRefs(state),
      saveSettings
    };
  }
};
</script>

<style scoped>
.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 15px;
}

.preferences-group {
  width: 100%;
}

.language-combo {
  width: 200px;
  margin-bottom: 15px;
}

.links-group {
  width: 100%;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.links-list a {
  color: #409eff;
  text-decoration: none;
}

.links-list a:hover {
  text-decoration: underline;
}
</style>